package person.inertia.inertia20251107a.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller  //@注解，不编译，会运行，第三方代码，嵌入，相当于 新*
//spring容器创建一个对象，名字"loginController"
@RequestMapping("/Login")
public class LoginController {
    @RequestMapping("getPage")
    public String getPage(String page) {
        return page;
    }
    @RequestMapping("validate")
    public String validate(String username, String password ,Model model) {
        System.out.println("your name is " + username+",your password is " + password);

        model.addAttribute("username", username);
        model.addAttribute("password", password);

        return "system";
    }
}
